import java.awt.event.MouseAdapter;
public class Computer {
    public void powerOn(){
        System.out.println("打开电脑");
    }
    public void poweroff(){
        System.out.println("关闭电脑");
    }
    public void useDevice(IUSB iusb){
        iusb.openDevice();
        if(iusb instanceof mouse){
//            mouse mouse=(mouse)iusb;
//                mouse.clink();
            ((mouse) iusb).clink();
        }else if (iusb instanceof keyBoard){
            keyBoard keyBoard=(keyBoard) iusb;
            keyBoard.inPut();
        }
        iusb.closeDevice();
    }
}
